#ifndef RES_LR1_2
#define RES_LR1_2
namespace res2
{

class c_ochered
{

 private:
	 
	 struct ochered
	 	{
	 	char inf;
	 	int pos;
	 	ochered *nxt;
	 	};
	 
	 ochered * Q;
	 
 public:
	 c_ochered()
	 {
		 Q = 0;
	 }
	 
	 ~c_ochered()
	 	 {
		 ochered* tmp;
     	while (Q != 0)
	    	{
			tmp = Q;
			Q = (Q) -> nxt;
			delete tmp;
		 	}
		 }
	 bool is_empty ()
	 {
	  if ( Q!=0 ) return false;
	  else return true;
	 }
	 //dobavlenie
	 void push (char inf)
	 {
	     ochered *newel, *cur, *prev;
	     
	    prev = 0;
	    
	 	newel = new ochered;
	 	newel -> inf = inf;
	 	newel -> nxt = 0;
	 	cur = Q;

	 	while (cur != 0)
	 	{
	 		prev = cur;
	 		cur = cur->nxt;
	 	}
	 	if (prev != 0)
	 		prev -> nxt = newel;
	 	else
	 		Q = newel;	
	 }
	 
	 //chtenie udalenie 
	 char pop ()
	 {
	 	ochered* tmp;
	 	char inf;
        inf = (char)0;
	 	if (Q != 0)
	 	{
	 		tmp = Q;
	 		Q = (Q) -> nxt;
	 		inf = tmp->inf;
	 		delete tmp;
	 		return inf;
	 	}
	 	else return inf;

	 }
	 
};

 
}

#endif 
